import axios from '@iframe/tools/axios/axios.js'

/**
 * 登录
 * @param params
 */
export function login(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/login`,
        method: 'post',
        data: params
    })
}

/**
 * 获取验证码
 */
export function getCaptcha(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/captcha`,
        method: 'get',
        params
    })
}

/**
 * 退出
 */
export function logout() {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/logout`,
        method: 'get'
    })
}

export function getLatest() {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/version/latest`,
        method: 'get'
    })
}
